package cn.ruituo.adv6;

import java.util.*;

public class Lottery {
    public static void main(String[] args) {
        List<Integer> zhong=new ArrayList<>();
        zhong.add(3);
        zhong.add(9);
        zhong.add(14);
        zhong.add(23);
        zhong.add(26);
        zhong.add(31);

        zhong.add(6);//blue ball
        //////////
        List<Integer> choose=new ArrayList<>();
        choose.add(3);
        choose.add(9);
        choose.add(15);
        choose.add(23);
        choose.add(26);
        choose.add(31);

        choose.add(6);//blue ball
        //篮球必须先删除，否则会判断失误
        int bluezhong=zhong.remove(zhong.size()-1);//
        int bluexuan=choose.remove(choose.size()-1);//
        boolean blue=bluexuan==bluezhong;
        choose.retainAll(zhong);
        System.out.println(choose.size());
        int count=choose.size();
        if(choose.size()==6&&blue){
            System.out.println("一等奖");
        }else if(choose.size()==6){
            System.out.println("2等奖");
        }else if(choose.size()==5&&blue){
            System.out.println("3等奖");
        } else if (count == 5 || (count == 4 && blue))
            System.out.println("\n恭喜您获得四等奖！");
        else if (count == 4 || (count == 3 && blue))
            System.out.println("\n恭喜您获得五等奖！");
        else if (blue) {
            System.out.println("\n恭喜您获得六等奖！");
        } else
            System.out.println("\n感谢您的参与和支持！");
    }
}
